package com.hyou.sc.common.handler.feign;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import feign.Feign;

@Configuration
public class EnableFeignRequestWithHeadersConfig {
    
    private static final Logger log = LoggerFactory.getLogger(EnableFeignRequestWithHeadersConfig.class);
    
    @Bean
    public Feign.Builder feignBuilder() {
        log.info("Feign层，启用FeignRequestInterceptor，转发携带请求头。");
        return Feign.builder().requestInterceptor(new FeignRequestInterceptor());
    }
    
}
